JlojaCategories = {

	PARAM_NAME: 'param[cat][]',

	init: function()
	{
		jQuery( '#categories-available-list' ).treeview();
	},

	u: function( el, idCat )
	{
		try{
			el = jQuery( el );
			el = el.children( 'span' ).get( 0 );
			ell = jQuery( '#param-categories-added' ).children( 'input[value=' + idCat + ']' );
			
			if(  ell.length > 0 ){
				ell.remove();
			}
			else{
				var label = el.innerHTML;
				var fname = this.inputName;
				var appendElement = '<div id="' + idCat + '" onclick="jQuery( this ).remove();">  X <span>'+label+'</span><input type="hidden" name="'+this.PARAM_NAME+'" value="'+idCat+'" /></div>';
				jQuery( '#param-categories-added' ).append( appendElement );
			}
		}catch( exception )
		{
			JLojaDebug.addError( exception );
		}
	}
}